package com.yami.shop.mystery.common.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yami.shop.bean.model.ShopDealer;
import com.yami.shop.bean.vo.search.MicroreleaseProductSearchVo;
import com.yami.shop.common.bean.PageDTO;
import com.yami.shop.common.bean.PageVO;
import com.yami.shop.mystery.common.dto.ActivityPresellDto;
import com.yami.shop.mystery.common.dto.ActivityProdDataDto;
import com.yami.shop.mystery.common.dto.ActivityProdDto;
import com.yami.shop.mystery.common.model.ActivityPresell;
import com.yami.shop.mystery.common.vo.ActivityPresellPageVo;

import java.util.List;

/**
 * 活动业务接口
 *
 * @author wxf
 * @date 2023/4/12 10:30
 */
public interface ActivityPresellService extends IService<ActivityPresell> {

    /**
     * 活动分页列表
     *
     *
     * @param pageDTO
     * @param dto
     * @return
     */
    PageVO<ActivityPresellDto> pageList(PageDTO pageDTO, ActivityPresellPageVo dto);

    /**
     *  保存/修改活动
     *
     * @param dto
     * @return
     */
    boolean saveOrUpdate(ActivityPresellDto dto);

    /**
     * 删除活动
     * @param ids
     */
    void removeIds(List<Long> ids);

    /**
     * 通过活动id查询活动信息
     *
     * @param id
     * @return
     */
    ActivityPresellDto detail(Long id);

    /**
     * 根据店铺id失效店铺的秒杀活动
     * @param shopId
     * @return 失效的秒杀活动
     */
    List<ActivityPresell> invalidByShopId(Long shopId);

    /**
     *  获取活动时间内的活动列表
     *
     * @return
     */
    List<ActivityPresellDto> getList(String activityIds);

    /**
     *  获取活动时间内的需要补货的活动列表
     *
     * @return
     */
    List<ActivityPresellDto> getAutoReplenishList();


    /**
     * 获取活动时间内的活动列表通过活动类型
     * @return
     * @param activityType
     */
    List<ActivityPresellDto> selectAllActivityPresellByActivityType(Integer activityType);

    /**
     * 获取活动时间内的活动列表通过商品id
     * @return
     * @param prodId
     */
    List<ActivityPresellDto> selectAllActivityPresellByProdId(Long prodId);

    /**
     * 功能描述: 获取上架的商品ID
     * @Author: LSR
     * @Date: 2023/4/19 18:18
     */
    List<ActivityProdDto> getPutawayProdId();

    List<ActivityPresellDto> selectAllActivityPresellByActivityTypes(List<Long> asList);

    List<ActivityPresellDto> selectAllActivityPresellByActivityIds(List<String> asList, List<Long> activitys);

    boolean saveOrUpdateNewcomerRewards(ActivityPresellDto dto);

    /**
     * 获取商品参与活动的有效活动总库存数
     * @return
     * @param prodId prodId
     */
    Integer selectStocksByProdId(Long prodId);

    /**
     * 修改库存
     * @param activityId
     * @param prodCount
     * @return
     */
    int updateStocksById(Long activityId,Integer prodCount);

    /**
     * 还原库存
     *
     * @param activityId
     * @param prodCount
     */
    int returnStocks(Long activityId, Integer prodCount);


    void cancelUnpayOrderByOrder(Long activityId,String orderNumber);

    PageVO<MicroreleaseProductSearchVo> selectPageActivityPresellByActivityIds(PageDTO page, List<String> activityIds, List<Long> activityType);

    ActivityProdDataDto getDataByActivityAndProdId(Long activityId, Long prodId);

    ActivityProdDataDto getDataByProdIds(Long pids);

    ShopDealer getDealerByActivityId(Long activityId);
}
